﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls="clr-namespace:PSE.Framework.UI.Controls.SmartClient;assembly=PSE.Framework.UI.Controls">

    <!--BEGIN SLIDING PANEL-->
    <Style x:Key="ControlSlidingPanelButtonLeft" BasedOn="{x:Null}" TargetType="{x:Type Button}">
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Width" Value="12.573"/>
        <Setter Property="Height" Value="12.573"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid x:Name="botao_novo_aba">
                        <Ellipse Stroke="{x:Null}" x:Name="bola_baixo" Fill="{DynamicResource BrushSlidingPanelButtonBorder}"/>
                        <Ellipse Stroke="{x:Null}" Margin="0.688,0.688,0.684,0.684" x:Name="bola_cima" Fill="{DynamicResource BrushSlidingPanelButtonBackground}"/>
                        <Path Stretch="Fill" Stroke="{x:Null}" Margin="4.218,2.829,1.967,3.357" RenderTransformOrigin="0.487086945640548,0.512967964248979" Data="M0,0 L9.0980336,0 9.0980336,9.0980338 0,0 z" x:Name="bola_seta_esquerda" Fill="{DynamicResource BrushSlidingPanelButtonIconBackground}">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="-1" ScaleY="-1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="45"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushSlidingPanelButtonBackgroundHover}" TargetName="bola_cima"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushSlidingPanelButtonBorderPressed}" TargetName="bola_baixo"/>
                            <Setter Property="Fill" TargetName="bola_cima" Value="{DynamicResource BrushSlidingPanelButtonBackgroundPressed}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ControlSlidingPanelButtonRight" BasedOn="{x:Null}" TargetType="{x:Type Button}">
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Width" Value="12.573"/>
        <Setter Property="Height" Value="12.573"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid x:Name="botao_novo_aba">
                        <Ellipse Stroke="{x:Null}" x:Name="bola_baixo" Fill="{DynamicResource BrushSlidingPanelButtonBorder}"/>
                        <Ellipse Stroke="{x:Null}" Margin="0.688,0.688,0.684,0.684" x:Name="bola_cima" Fill="{DynamicResource BrushSlidingPanelButtonBackground}"/>
                        <Path Stretch="Fill" Stroke="{x:Null}" Margin="1.672,2.829,4.509,3.357" RenderTransformOrigin="0.487086945640548,0.512967964248979" Data="M0,0 L9.0980336,0 9.0980336,9.0980338 0,0 z" x:Name="bola_seta_direita" Fill="{DynamicResource BrushSlidingPanelButtonIconBackground}">
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="-1"/>
                                    <SkewTransform AngleX="0" AngleY="0"/>
                                    <RotateTransform Angle="-45"/>
                                    <TranslateTransform X="0" Y="0"/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushSlidingPanelButtonBackgroundHover}" TargetName="bola_cima"/>
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Fill" Value="{DynamicResource BrushSlidingPanelButtonBorderPressed}" TargetName="bola_baixo"/>
                            <Setter Property="Fill" TargetName="bola_cima" Value="{DynamicResource BrushSlidingPanelButtonBackgroundPressed}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type Controls:SlidingPanel}">
		<Setter Property="Height" Value="400"/>
		<Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Panel.ZIndex" Value="998"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
		<Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:SlidingPanel}">
                    <Border x:Name="Border" HorizontalAlignment="Right" Width="{TemplateBinding Width}" VerticalAlignment="Stretch" ToolTip="{TemplateBinding Header}">
                        <Grid>
                            <Border BorderBrush="{DynamicResource BrushSlidingPanelBorder}" BorderThickness="1" Margin="22,0,0,0" CornerRadius="6" x:Name="Part_Painel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource BrushSlidingPanelBackground}"/>
                            <Rectangle Fill="{DynamicResource BrushSlidingPanelTabBackground}" Stroke="{DynamicResource BrushSlidingPanelBorder}" RadiusX="6" RadiusY="6" HorizontalAlignment="Left" Margin="0,0.011,0,0" VerticalAlignment="Top" Width="36.425" Height="25.604" x:Name="Part_PainelAba"/>
                            <Border Width="8" BorderThickness="0,0,1,0" BorderBrush="{DynamicResource BrushSlidingPanelBorder}" VerticalAlignment="Top" HorizontalAlignment="Right" Height="23.604" Margin="0,1" x:Name="TransformBorder" Visibility="Hidden"/>
                            <Rectangle Fill="{DynamicResource BrushSlidingPanelTabBackground}" Stroke="{x:Null}" RadiusX="0" RadiusY="0" HorizontalAlignment="Left" Margin="23,1.004,0,0" x:Name="Part_BandAid" VerticalAlignment="Top" Width="21.021" Height="25.643"/>
                            <Label x:Name="Part_Header" Height="20" Padding="0" VerticalAlignment="Top" Content="{TemplateBinding Header}" Margin="30,5.947,0,0" Style="{DynamicResource ControlFont}"/>
                            <Border x:Name="Part_Content" Background="Transparent" Margin="29.5,26.5,7,7">
                                <ContentPresenter/>
                            </Border>
                            <Button HorizontalAlignment="Left" x:Name="Part_ButtonLeft" Margin="4.674,6.321,0,0" Style="{DynamicResource ControlSlidingPanelButtonLeft}" Visibility="Hidden"/>
                            <Button HorizontalAlignment="Left" x:Name="Part_ButtonRight" Margin="4.674,6.321,0,0" Style="{DynamicResource ControlSlidingPanelButtonRight}" Visibility="Hidden"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasHeader" Value="False">
                            <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=ToolTip}" TargetName="Border"  />
                        </Trigger>
                        <Trigger Property="IsClosed" Value="True">
                            <Setter Property="Visibility" Value="Hidden" TargetName="Part_Header"/>
                            <Setter Property="Visibility" Value="Hidden" TargetName="Part_Content"/>
                            <Setter Property="Visibility" Value="Visible" TargetName="TransformBorder"/>
                            <Setter Property="Width" Value="22"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsClosed" Value="True"/>
                                <Condition Property="SlidingPanelPlacement" Value="Left"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="HorizontalAlignment" Value="Left" TargetName="TransformBorder"/>
                            <Setter Property="BorderThickness" Value="1,0,0,0" TargetName="TransformBorder"/>
                            <Setter Property="Visibility" Value="Visible" TargetName="Part_ButtonRight"/>
                            <Setter Property="Margin" Value="0,6.321,4.674,0" TargetName="Part_ButtonRight"/>
                            <Setter Property="HorizontalAlignment" Value="Right" TargetName="Part_ButtonRight"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsClosed" Value="True"/>
                                <Condition Property="SlidingPanelPlacement" Value="Right"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="Part_ButtonLeft"/>
                            <Setter Property="Margin" Value="4.674,6.321,0,0" TargetName="Part_ButtonLeft"/>
                            <Setter Property="HorizontalAlignment" Value="Left" TargetName="Part_ButtonLeft"/>
                        </MultiTrigger>
                        <Trigger Property="SlidingPanelPlacement" Value="Left">
                            <Setter Property="Margin" Value="0,0,22,0" TargetName="Part_Painel"/>
                            <Setter Property="HorizontalAlignment" Value="Right" TargetName="Part_PainelAba"/>
                            <Setter Property="Margin" Value="0,1.004,23,0" TargetName="Part_BandAid"/>
                            <Setter Property="HorizontalAlignment" Value="Right" TargetName="Part_BandAid"/>
                            <Setter Property="Margin" Value="7,26.5,29.5,7" TargetName="Part_Content"/>
                            <Setter Property="Margin" Value="7,5.947,0,0" TargetName="Part_Header"/>
                            <Setter Property="HorizontalAlignment" Value="Left"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsClosed" Value="False"/>
                                <Condition Property="SlidingPanelPlacement" Value="Left"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="Part_ButtonLeft"/>
                            <Setter Property="Margin" Value="0,6.321,4.674,0" TargetName="Part_ButtonLeft"/>
                            <Setter Property="HorizontalAlignment" Value="Right" TargetName="Part_ButtonLeft"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsClosed" Value="False"/>
                                <Condition Property="SlidingPanelPlacement" Value="Right"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" Value="Visible" TargetName="Part_ButtonRight"/>
                            <Setter Property="Margin" Value="4.674,6.321,0,0" TargetName="Part_ButtonRight"/>
                            <Setter Property="HorizontalAlignment" Value="Left" TargetName="Part_ButtonRight"/>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--END SLIDING PANEL-->
</ResourceDictionary>